From 81b1e0e05919eb368a66aef47adcf7738af76f29 Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 29 Sep 2023 11:47:06 +0200
Subject: refactor(components): rewrite Spinner component

* Message should be set as children
* Default message is no longer available (depending on use case, the
consumer might prefer aria-label instead)
* It is now possible to define the message position
---
 src/pages/projets/[slug].tsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'src/pages/projets/[slug].tsx')

diff --git a/src/pages/projets/[slug].tsx b/src/pages/projets/[slug].tsx
index afcf060..717ae13 100644
--- a/src/pages/projets/[slug].tsx
+++ b/src/pages/projets/[slug].tsx
@@ -170,6 +170,12 @@ const ProjectPage: NextPageWithLayout<ProjectPageProps> = ({ project }) => {
     return links;
   };
 
+  const loadingRepoPopularity = intl.formatMessage({
+    defaultMessage: 'Loading the repository popularity...',
+    description: 'ProjectsPage: loading repository popularity',
+    id: 'RwI3B9',
+  });
+
   const { isError, isLoading, data } = useGithubApi(
     /*
      * Repo should be defined for each project so for now it is safe for my
@@ -182,7 +188,7 @@ const ProjectPage: NextPageWithLayout<ProjectPageProps> = ({ project }) => {
   );
 
   if (isError) return 'Error';
-  if (isLoading || !data) return <Spinner />;
+  if (isLoading || !data) return <Spinner aria-label={loadingRepoPopularity} />;
 
   const getRepoPopularity = (repo: string) => {
     const stars = intl.formatMessage(
-- 
cgit v1.2.3

